package cn.genmer.test.security.model.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

@Data//自动生成get、set、tostring
@Accessors(chain = true)//支持set方法返回一个对象，可以连点
@ColumnWidth(20)// 表示列宽
public class Dept {
    
    //@ExcelProperty中value代表列名，index代表列号
    @ExcelProperty(value = "部门编号", index = 0)
    private int deptno;

    @ExcelProperty(value = "部门地址", index = 1)
    private String loc;

    @ExcelProperty(value = "部门名称", index = 2)
    private String dname;

    //@DateTimeFormat格式化时间
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelProperty(value = "创办时间", index = 3)
    private Date birthday;

    //@NumberFormat格式化数字
    @NumberFormat("#.##")
    @ExcelProperty(value = "平均薪资", index = 4)
    private double money;

}
